package com.example.competitionregistration.util;

import java.util.Random;

/**
 * @Author QuanJingFang
 * @Description //TODO 生成账号
 * @Date 2023/7/29 18:51
 **/
public class GenerateAccount {
    private static final String NUMBERS = "0123456789";
    private static final int ID_LENGTH = 8;

    public static String generateUniqueId() {
        StringBuilder sb = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < ID_LENGTH; i++) {
            int index = random.nextInt(NUMBERS.length());
            sb.append(NUMBERS.charAt(index));
        }
        return sb.toString();
    }
}
